# Transition - All transition effects has to implement this interface!
# Copyright (C) 2007 Lauri Taimila
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

class Transition:
    """
    Transition interface
    
    All transition effects has to implement this interface! Transition
    implements effect that is used between screen chanages. This can for
    example fade, slide, zoom, etc.
    """
    
    # These constants are used to spesify the 
    # direction of the screen change process.
    FORWARD = 0
    BACKWARD = 1
    
    def __init__(self, stage):
        """
        Initialize transition effect.
        @param stage: Stage object
        """
        self.stage = stage # Stage object (for removing screen)
        self.direction = self.__class__.FORWARD # Default direction
    
    def forwardEffect(self, from_screen, to_screen):   
        """ 
        Animate transition from 'from_screen' to 'to_screen'. This function
        should remove "from_screen" textures and widgets from view and add
        "to_screen" widgets and other stuff to view. While doing this it
        should look nice. Notice that 'from_screen' is None when the Main screen
        is displayed at the first time. Eg. when application starts up.
        """
        pass
        
    def backwardEffect(self, from_screen, to_screen):   
        """ 
        Animate transition from 'from_screen' to 'to_screen'. This function
        should remove "from_screen" textures and widgets from canvas and add
        "to_screen" widgets and other stuff to canvas. While doing this it
        should look nice. THIS IS CALLED WHEN USER HITS 'BACK' BUTTON. Usually
        it looks good and logical if animation is done backwards. This gives
        the feel of getting back to the previous screen.
        """
        pass
    
